<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        h2 {
            text-align: center;
        }

        table {
            height: 80px;
            margin: 0 auto;
        }

        table,
        th,
        td {
            border: 1px solid black;
            border-collapse: collapse;
        }

        th,
        td {
            padding: 5px 30px;
        }
    </style>
</head>

<body>
    <script>
        let total = +prompt('请输入您的银行卡总额: ');
        let water = +prompt('请输入您的水费: ');
        let electricity = +prompt('请输入您的电费: ');
        let internet = +prompt('请输入您的网费: ');
        let balance = total - (water + electricity + internet);
        document.write(`
            <h2>2025年8月消费支出</h2>
            <table>
                <tr>
                    <th>银行卡总额</th>
                    <th>水费</th>
                    <th>电费</th>
                    <th>网费</th>
                    <th>银行卡余额</th>
                 </tr>
                <tr>
                    <td>${total}元</td>
                    <td>${water}元</td>
                    <td>${electricity}元</td>
                    <td>${internet}元</td>
                    <td>${balance}元</td>
                </tr>
            </table>
        `)
    </script>
</body>

</html>